Skip to content

CAUSEWAY-4044: Work towards immutable ObjectSpecification - #3697

Draft
andi-huber wants to merge 21 commits into
mainfrom
4044-stable.objspec
Draft

CAUSEWAY-4044: Work towards immutable ObjectSpecification#3697
andi-huber wants to merge 21 commits into
mainfrom
4044-stable.objspec

Conversation

@andi-huber

@andi-huber andi-huber commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Motivation: The current ObjectSpecification implementation is fragile and leads to a non deterministic outcome of the Metamodel inspection.

  • Factor out Member creation into factory classes
  • Facet caching is in conflict with lazy initialization. Query for Facets that are not populated yet can taint the cache and lead to an incorrect Metamodel.
  • When evicting a Spec from the Spec Loader's cache, there are no guarantees that no other Spec is holding on the the eviced Spec.
  • Unclear policy, as to whether we need to lookup the type hierarchy for Facets. (see Hierarchical)
  • Mixins may be discovered only after the prior known set of mixins had already been added to object specifications.
  • To yield immutability perhaps use the Builder design pattern. (namely an ObjectSpecificationBuilder)

Task-Url: https://issues.apache.org/jira/browse/CAUSEWAY-4044

@andi-huber andi-huber self-assigned this Jul 29, 2026
@andi-huber
andi-huber force-pushed the 4044-stable.objspec branch 3 times, most recently from 4ec0a77 to b39c2df Compare August 5, 2026 15:31
@andi-huber
andi-huber force-pushed the 4044-stable.objspec branch from 73daf42 to d5b2bb1 Compare August 6, 2026 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant